<%--
  @desc: 下载日志列表
  @author: chenw
  @create: 2014-4-29 下午 15:32
--%>
<%@ page contentType="text/html;charset=utf-8" language="java"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<div class="pageHeader">
	<form rel="pageForm" onsubmit="return navTabSearch(this);"
		action="<c:url value='/sys/download/index'/>" method="post">
		<div class="searchBar">
			<ul>
				<li style="float: left; line-height: 25px;"><label>下载时间：</label>
					<input name="start" type="text" class="date"
					datefmt="yyyy-MM-dd HH:mm:ss" id="start"
					value="<fmt:formatDate value="${query.start}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					placeholder="起始时间"
					style="width: 100px; font-family: '微软雅黑 sans-serif serif';" /> - <input
					name="end" type="text" class="date" id="end"
					datefmt="yyyy-MM-dd HH:mm:ss"
					value="<fmt:formatDate value="${query.end}" pattern="yyyy-MM-dd HH:mm:ss"/>"
					placeholder="结束时间"
					style="width: 100px; font-family: '微软雅黑 sans-serif serif';" />
				</li>

				<li style="float: left; line-height: 25px;"><label>版本下载：</label>
					<select name="handler">
						<option value="" selected="selected">全部</option>
						<option value="1"
							<c:if test="${query.handler==1}">selected="selected"</c:if>>IOS下载
						</option>
						<option value="2"
							<c:if test="${query.handler==2}">selected="selected"</c:if>>Andriod下载
						</option>
				   </select>
				</li>
			
				<li>
					<div class="buttonActive" style="margin-left: 5px;">
						<div class="buttonContent">
							<button type="submit">查找</button>
						</div>
					</div>
				</li>
				<li>
					<div class="buttonActive" style="margin-left: 5px;">
						<div class="buttonContent">
							<button type="button" onclick="exportExcel()">导出</button>
						</div>
					</div>
				</li>
			</ul>
		</div>
	</form>
</div>
<div class="pageContent" style="padding-top: 1px;">
	<table nowrapTD="false" class="table" width="100%" layoutH="115">
		<thead>
			<tr>
				<th width=40 align="center">序号</th>
				<th width=140 align="center">下载时间</th>
				<th >浏览器类型</th>


				<th width=80>版本下载</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="download" items="${pager.list}" varStatus="vs">
				<tr target="sel_id" rel="${download.id}">
					<td>${vs.count+(pager.pageNum-1)*pager.numPerPage}</td>
					<td><fmt:formatDate value="${download.createTime}"
							pattern="yyyy-MM-dd HH:mm" /></td>
					<td title='${download.clientBrowser}'>${download.clientBrowser}</td>

					<td><c:choose>
							<c:when test="${download.type==1}">
                IOS下载
                </c:when>
							<c:when test="${download.type==2}">
                Andriod下载
                </c:when>
						</c:choose></td>

				</tr>
			</c:forEach>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示&nbsp;</span> <select id="cob_ps" class="combox"
				name="numPerPage"
				onchange="navTabPageBreak({numPerPage:this.value})">
				<option value="20">20</option>
				<option value="50">50</option>
				<option value="100">100</option>
				<option value="200">200</option>
			</select> <span>条，共${pager.total}条</span>
		</div>
		<div class="pagination" targetType="navTab"
			totalCount="${pager.total}" numPerPage="${pager.numPerPage}"
			pageNumShown="10" currentPage="${pager.pageNum}"></div>
	</div>
	<form id="pagerForm" method="post"
		action="<c:url value='/sys/download/index'/>">
		<input type="hidden" name="pageNum" value="${pager.pageNum}" /> <input
			type="hidden" name="end"
			value="<fmt:formatDate value="${query.end}" pattern="yyyy-MM-dd HH:mm:ss"/>" />
		<input type="hidden" name="start"
			value="<fmt:formatDate value="${query.start}" pattern="yyyy-MM-dd HH:mm:ss"/>" />
		<input type="hidden" name="keywords" value="${query.keywords}" /> <input
			type="hidden" name="numPerPage" value="${pager.numPerPage}" /> <input
			type="hidden" name="handler" value="${query.handler}" /> <input
			type="hidden" name="orderDirection" value="${query.orderDirection}" />
	</form>
</div>
<script type="text/javascript">
	function exportExcel() {
		var end = $("#end").val();
		var start = $("#start").val();
		window.location.href = "${pageContext.request.contextPath }/sys/download/exportExcel.xls?end="
				+ end + "&start=" + start + "&handler=${query.handler}"
	}
</script>